package com.ldc.framework.adapter

import com.ldc.commonlibs.listener.OnRowListener
import com.ldc.commonres.common.BaseRvAdapter
import com.ldc.commonres.common.BaseRvViewHolder
import com.ldc.commonres.uts.GlideUts
import com.ldc.framework.R
import com.ldc.framework.model.ProfileViewItemModel

class ProfileitemListAdapter :
    BaseRvAdapter<ProfileViewItemModel>(R.layout.framework_layout_view_profile_view_item) {
    private var onRowListener: OnRowListener<ProfileViewItemModel>? = null
    fun addOnRowListener(onRowListener: OnRowListener<ProfileViewItemModel>?) {
        this.onRowListener = onRowListener
    }

    override fun convertTo(holder: BaseRvViewHolder, data: ProfileViewItemModel, position: Int) {
        holder.setText(R.id.tv_name, data.name)
        holder.addOnRowListener(holder.itemView, data, onRowListener)
        holder.setImage(R.id.iv_icon, data.res)

    }
}